<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>新闻管理系统</title>
	<style type="text/css">
		table{
			font-family:微软雅黑;
			border-collapse:collapse;

		}
		h3{
			font-family:微软雅黑;
		}

	</style>
</head>
<body>
	<center>
		<?php include('menu.php');//导入导航栏?>

		<h3>修改新闻信息</h3>

		
		<?php

			$id = $_GET['id'];
			//引入数据库
			require('config.php');

			//链接数据库
			$link =@mysql_connect(HOST,USER,PWD) or die('连接数据库失败!');

			mysql_select_db(DBNAME);

			mysql_set_charset(UTF);

			//准备sql语句 执行sql语句
			$sql= "select * from news where id = {$id}";
			//louecho $sql;

			$result= mysql_query($sql);

			if(mysql_num_rows($result)>0){

				$row = mysql_fetch_assoc($result);

				//var_dump($row);

		?>
				<form action="action.php?action=update&id=<?php echo $id?>" method='post'>
				<table border='0' width='400' >				

				<tr>
					<td align='right'>标题:</td>
					<td><input type="text" name='title' value="<?php echo $row['title']?>"></td>
				</tr>
				<tr>
					<td align='right'>关键字:</td>
					<td><input type="text" name='keywords' value="<?php echo $row['keywords']?>"></td>
				</tr>
				<tr>
					<td align='right'>作者:</td>
					<td><input type="text" name='author' value="<?php echo $row['author']?>"></td>
				</tr>
				<tr>
					<td align='right'>内容:</td>
					<td><textarea name="content" id="" cols="30" rows="5" style='resize:none'>
						<?php echo $row['content']?>
					</textarea></td>
				</tr>
				<tr>
					<td colspan='3' align='center'>
						<input type="submit" value='修改' />&nbsp;&nbsp;&nbsp;
						<input type="reset" value='重置' />
					</td>
					
				</tr>


		<?php
					
			} 

		?>

			</table>
		</form>
	</center>	
</body>
</html>